const Pipeline = require('node-spider').Pipeline;
var count = 0;
module.exports.Pipeline = class extends Pipeline{
    constructor(){
        super();
        this.time = '';
    }
    //爬虫开始运行
    start(){
        console.log('爬虫开始运行了');
        this.time = Date.now();
    }
    //处理数据
    handle(result,spider){
        count++;
        console.log(result);
    }
    //关闭爬虫
    close(){
        console.log('爬虫运行结束，总计耗时:'+(Date.now()-this.time));
        console.log('共计数据:'+count);
    }
}